<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c" uri="http://java.sun.com/jsp/jstl/core" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<link rel="stylesheet" href="static/css/bootstrap.min.css" />
	<link rel = "stylesheet" href = "static/css/globle.css"/>
	<script type="text/javascript" src = "static/js/jquery.js"></script>
	<title></title>
</head>
<body>
	  <div class="navbar navbar-fixed-top" id = "manager">
			<div class="navbar-inner">
				<div class="container">
					<a  class = "brand" href="#" >项目管理系统</a>
			
				</div>
			</div>
		 </div>
	<div class="container" style = "margin-top:40px">
		<div class="row">
			<div class="span12">
				<div class="page-header">
					<h1>添加一个新目标</h1>
				</div>
			</div>
		</div>
		<div class="row">
			<div class = "span12">
			    <form class="form-horizontal" action = "goal.jspx?_m=addGoal" method = "post" id = "myform">
				    <fieldset>
					    <div class="control-group">
						    <label class="control-label" for="input01">目标名称</label>
						    <div class="controls">
						    <input style = "width:450px" type="text" class="input-xlarge" id="input01" x-webkit-speech x-webkit-grammar = "builtin:translate" name = "name"><c:if test = "${param.code == '800'}"><span>该目标已经存在</span></c:if><span id = "name-error"></span>
						    <p class="help-block">Supporting help text</p>
					    	</div>
					    </div>
					    <div class="control-group" >
				            <label for="textarea" class="control-label">目标的主要描述</label>
				            <div class="controls">
				              <textarea rows="10" id="textarea" class="input-xlarge" style = "width:450px" name = "dec" ></textarea><br/>
				            </div>
				              <span id = "dec-error"></span>
				         </div>
				         
				       
				          
				        
					     <div class="form-actions" style = "background-color:white;border-top:none">
				            <button class="btn btn-primary" type="submit" id = "btn" >保存</button>
				            <button class="btn" type = "button"><a href = "goal.jspx">返回</a></button>
				          </div>
				    </fieldset>
				 </form>
				</div>
		</div>
				
	</div>
	<%-- 
	<script type="text/javascript">
		$(document).ready(function(){
			var name = $("input[name = 'name']").val();
			var dec = $("#textarea").val();
			$("input[name='name']").keydown(function(){
				$("#name-error").html("");
			})
			$("#textarea").keydown(function(){
				$("#dec-error").html("");
			})
			
			$("#btn").click(function(){
				if(name.trim() == ""){
					$("#name-error").html("目标名称必填");
					$("input[name = 'name']").focus();
					return;
				}
		
			
			
				if(dec.trim() == ""){
					$("#dec-error").html("描述必填");
					$("#textarea").focus();
					return;
				}
				$("#myform").submit();
			})
				
			
			
		})
	</script>
	--%>
</body>
</html>